import request from '@/utils/request'

// 查询档案目录列表
export function listDirectory(query) {
    return request({
        url: '/business/directory/list',
        method: 'get',
        params: query
    })
}

// 查询档案目录详细
export function getDirectory(id) {
    return request({
        url: '/business/directory/' + id,
        method: 'get'
    })
}

// 新增档案目录
export function addDirectory(data) {
    return request({
        url: '/business/directory',
        method: 'post',
        data: data
    })
}

// 修改档案目录
export function updateDirectory(data) {
    return request({
        url: '/business/directory',
        method: 'put',
        data: data
    })
}

// 删除档案目录
export function delDirectory(id) {
    return request({
        url: '/business/directory/' + id,
        method: 'delete'
    })
}

// 导出档案目录
export function exportDirectory(query) {
    return request({
        url: '/business/directory/export',
        method: 'get',
        params: query
    })
}

// 导出档案目录
export function topAndLeaf(personId) {
    return request({
        url: '/business/directory/top_and_leaf',
        method: 'get',
        params: {personId}
    })
}

// 导出档案目录
export function directoryTree(query) {
    return request({
        url: '/business/directory/tree',
        method: 'get',
        params: query
    })
}